import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

part 'index_event.dart';
part 'index_state.dart';

class IndexBloc extends Bloc<IndexEvent, IndexState> {
  IndexBloc() : super(IndexInitial()) {
    on<IndexChangeEvent>(_changeIndex);
  }

  Future<void> _changeIndex(
      IndexChangeEvent event, Emitter<IndexState> emit) async {
    emit(IndexUpdate(event.index));
  }
}
